|
brushless28 2.2.0
|
API for configuring and manipulating Brushless 28 Click driver. More...
Topics | |
| Brushless 28 Registers List | |
| List of registers of Brushless 28 Click driver. | |
| Brushless 28 Registers Settings | |
| Settings for registers of Brushless 28 Click driver. | |
| Brushless 28 MikroBUS Map | |
| MikroBUS pin mapping of Brushless 28 Click driver. | |
Functions | |
| void | brushless28_cfg_setup (brushless28_cfg_t *cfg) |
| Brushless 28 configuration object setup function. | |
| err_t | brushless28_init (brushless28_t *ctx, brushless28_cfg_t *cfg) |
| Brushless 28 initialization function. | |
| err_t | brushless28_default_cfg (brushless28_t *ctx) |
| Brushless 28 default configuration function. | |
| err_t | brushless28_write_reg (brushless28_t *ctx, uint8_t reg, uint16_t data_in) |
| Brushless 28 data writing function. | |
| err_t | brushless28_read_reg (brushless28_t *ctx, uint8_t reg, uint16_t *data_out) |
| Brushless 28 data reading function. | |
| err_t | brushless28_set_duty_cycle (brushless28_t *ctx, float duty_cycle) |
| Brushless 28 sets PWM duty cycle. | |
| err_t | brushless28_pwm_stop (brushless28_t *ctx) |
| Brushless 28 stop PWM module. | |
| err_t | brushless28_pwm_start (brushless28_t *ctx) |
| Brushless 28 start PWM module. | |
| void | brushless28_set_direction (brushless28_t *ctx, uint8_t dir) |
| Brushless 28 set direction function. | |
| void | brushless28_switch_direction (brushless28_t *ctx) |
| Brushless 28 switch direction function. | |
| void | brushless28_pull_brake (brushless28_t *ctx) |
| Brushless 28 pull brake function. | |
| void | brushless28_release_brake (brushless28_t *ctx) |
| Brushless 28 release brake function. | |
| uint8_t | brushless28_get_fault_pin (brushless28_t *ctx) |
| Brushless 28 get fault pin function. | |
API for configuring and manipulating Brushless 28 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void brushless28_cfg_setup | ( | brushless28_cfg_t * | cfg | ) |
Brushless 28 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See brushless28_cfg_t object definition for detailed explanation. |
| err_t brushless28_default_cfg | ( | brushless28_t * | ctx | ) |
Brushless 28 default configuration function.
This function executes a default configuration of Brushless 28 Click board.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t brushless28_get_fault_pin | ( | brushless28_t * | ctx | ) |
Brushless 28 get fault pin function.
This function returns the FAULT pin logic state.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| err_t brushless28_init | ( | brushless28_t * | ctx, |
| brushless28_cfg_t * | cfg ) |
Brushless 28 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See brushless28_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void brushless28_pull_brake | ( | brushless28_t * | ctx | ) |
Brushless 28 pull brake function.
This function pulls brake by setting the BRAKE pin to low logic state.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| err_t brushless28_pwm_start | ( | brushless28_t * | ctx | ) |
Brushless 28 start PWM module.
This function starts the PWM module output.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t brushless28_pwm_stop | ( | brushless28_t * | ctx | ) |
Brushless 28 stop PWM module.
This function stops the PWM module output.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t brushless28_read_reg | ( | brushless28_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t * | data_out ) |
Brushless 28 data reading function.
This function reads a data bytes word from the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void brushless28_release_brake | ( | brushless28_t * | ctx | ) |
Brushless 28 release brake function.
This function releases brake by setting the BRAKE pin to high logic state.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| void brushless28_set_direction | ( | brushless28_t * | ctx, |
| uint8_t | dir ) |
Brushless 28 set direction function.
This function sets the direction of motor rotation by setting the DIR pin logic state.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| [in] | dir | :
|
| err_t brushless28_set_duty_cycle | ( | brushless28_t * | ctx, |
| float | duty_cycle ) |
Brushless 28 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| [in] | duty_cycle | : PWM duty cycle. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void brushless28_switch_direction | ( | brushless28_t * | ctx | ) |
Brushless 28 switch direction function.
This function switches the direction of motor rotation by toggling the DIR pin logic state.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| err_t brushless28_write_reg | ( | brushless28_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t | data_in ) |
Brushless 28 data writing function.
This function writes a data word to the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See brushless28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.